VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "DAOCompania"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Option Explicit
Private mvarConnection As utilConexion 'local copy

Public Property Set Connection(ByVal vData As utilConexion)
'used when assigning an Object to the property, on the left side of a Set statement.
'Syntax: Set x.Connection = vData
    Set mvarConnection = vData
End Property


Public Function getLista(bean As bCompania) As Collection
'On Error GoTo hnderr
Dim sql As String
Dim rst As New Recordset
Dim list As New Collection
Dim record As New bCompania
Dim bPaginadorRecuperado As Boolean
sql = "SELECT sruc ,  srazsocial ,  nestado , sestado , sslogan, ndefault "
sql = sql + "FROM proc_compania_select(" + CStr(bean.bEstado.nCodigo) + ");"

rst.Open sql, mvarConnection.Connection, adOpenForwardOnly

While Not rst.EOF
    Set record = New bCompania
    If Not IsNull(rst.Fields("sruc")) Then record.sRuc = rst.Fields("sruc").value
    If Not IsNull(rst.Fields("srazsocial")) Then record.sRazonSocial = rst.Fields("srazsocial").value
    If Not IsNull(rst.Fields("nestado")) Then record.bEstado.nCodigo = rst.Fields("nestado").value
    If Not IsNull(rst.Fields("sestado")) Then record.bEstado.sDescripcion = rst.Fields("sestado").value
    If Not IsNull(rst.Fields("sslogan")) Then record.sSlogan = rst.Fields("sslogan").value
    If Not IsNull(rst.Fields("ndefault")) Then record.bPorDefecto = rst.Fields("ndefault").value
   
    rst.MoveNext
    list.Add record
Wend
Set getLista = list

hnderr:
If Err.Number = 0 Then Exit Function
cloneError Err
End Function



